/*styles for image gallery*/

/*Tabbed Content*/
.tab {
    display: none;
    padding-top: 25px;
    padding-bottom: 70px;
    background-color: transparent;
}

.tab.active {
    display: block;
}

.tab-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    background-color: transparent;
    border-radius: 8px;
    gap: 12px;
}

.tab-links li {
    margin-right: 0;
    padding: 0;
    background-color: #f7f7f7;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.tab-links li a {
    text-decoration: none;
    color: #6c757d;
    font-weight: 600;
    font-size: smaller;
    text-transform: uppercase;
    padding: 10px 20px;
    display: block;
    letter-spacing: 0.5px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tab-links li a:hover {
    color: #2b43c7;
}

.tab-links li.active {
    background-color: #2b43c7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-links li.active a {
    color: #fff;
}

.tab h2 {
    font-size: 1.8rem;
    margin-top: 10px;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.tab p {
    color: #5a626a;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 800px;
}

/*--------------------------------*/

/* GALLERY/POPUPS */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 11px;
    margin-top: 25px;
}

.gallery figure {
    position: relative;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #fff;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.gallery figure:hover {
    /*transform: translateY(-6px);*/
    /* box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);*/
    /*border-color: #d1d5db;*/
}

.gallery img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery figure:hover img {
    transform: scale(1.06);
}

/*position caption*/
.gallery figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    /* background: rgba(255, 255, 255, 0.95);*/
    background: #fafafa;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #1f2937;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    /* border-top: 1px solid rgba(0, 0, 0, 0.04);*/
    transition: background-color 0.3s ease;
    text-align: left;
    letter-spacing: 0.2px;
    text-transform: capitalize;
}

.gallery figure:hover figcaption {
    /*background-color: #ffffff;*/
}

/*--------------------------------*/

/* 3D BOOK CAROUSEL */
.carousel-viewport {
    width: 80%;
    height: 450px;
    perspective: 1200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fdfdfd;
    margin: 20px auto 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-book {
    position: relative;
    width: 250px;
    height: 350px;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-color: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    backface-visibility: hidden;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0px;
}

.carousel-caption {
    background: #dddddd;
    border: solid 1px #EEE;
    font-size: 0.9rem;
    padding: 5px 0 2px;
    margin: 0;
    text-transform: capitalize;
    text-align: center;
    color: #000;
}

.btn-page {
    background: #8aa0a2;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    min-width: 90px;
}

/* POPUP FADE EFFECTS */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background-color: #f9f9f9;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    max-width: 90vw;
    box-sizing: border-box;
}

.popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.popup img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

.popup p {
    margin: 15px 0 0 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: capitalize;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    z-index: 10000;
    user-select: none;
    line-height: 1;
}

.close:hover {
    background-color: #ffffff;
    color: #000;
    transform: scale(1.1);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}